package de.hhbk.feedbackmodul.entities;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * The persistent class for the teilnehmer database table.
 * 
 */
@Entity
@Table(name="teilnehmer")
public class Participant implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(unique=true, nullable=false)
	private int id;
	
	@Column(length=30,nullable=false)
	private String name;
	
	@Column(length=50,nullable=false)
	private String passwort;

	//bi-directional many-to-one association to Antwortbogen
	@OneToMany(mappedBy="teilnehmer",fetch=FetchType.EAGER)
	private Set<AnswerSheet> antwortbogens = new HashSet<AnswerSheet>();

    public Participant() {
    }

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Set<AnswerSheet> getAntwortbogens() {
		return this.antwortbogens;
	}

	public void setAntwortbogens(Set<AnswerSheet> antwortbogens) {
		this.antwortbogens = antwortbogens;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPasswort() {
		return passwort;
	}

	public void setPasswort(String passwort) {
		this.passwort = passwort;
	}
	
}